From: Juri Linkov Date: Sat, 22 Mar 2025 18:37:35 +0000 (+0200) Subject: * lisp/treesit.el (treesit-indent-region): Handle markers (bug#77077). X-Git-Tag: archive/raspbian/1%30.2+1-2+rpi1^2~2^2~24^2~186 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22Program/%22http:/www.example.com/cgi/%22https:/%22Program?a=commitdiff_plain;h=84abd43f42fec623d4939e3557a1da2b83e08562;p=emacs.git * lisp/treesit.el (treesit-indent-region): Handle markers (bug#77077). Ensure that markers are converted to integers for 'beg' and 'end'. --- diff --git a/lisp/treesit.el b/lisp/treesit.el index 2aa49a596d8..d40088178fc 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2010,6 +2010,8 @@ reparse after indenting every single line.") (defun treesit-indent-region (beg end) "Indent the region between BEG and END. Similar to `treesit-indent', but indent a region instead." + (when (markerp beg) (setq beg (marker-position beg))) + (when (markerp end) (setq end (marker-position end))) (treesit-update-ranges beg end) ;; We indent `treesit--indent-region-batch-size' lines at a time, to ;; reduce the number of times the parser needs to re-parse. In each